<?php

class news_widget extends iKernel{
	public $title;
	public $content;
	
	function news_widget(){
		$tpl = new Template;
		include("locale/en.php");
		
			$this->title = $locale['archive_title'];
			$db = new DB("news");
			$db->setColPrefix("news_");
			$db->setSort("news_id DESC");
			$db->select();	
			
			$db->limit = "5";

			$this->content = "<table style='width: 100%;'>";
			while($db->nextRecord()){
				$this->content .= "<tr><td style='width: 80%;'><a href='".iUrl::makeClean("?lang_id=en&page_url=news&var_a=".$db->id)."'>".trimlink($db->title, "20")."</a></td><td>".showdate("shortdate", $db->date)."</td></tr>";
			}
			$this->content .= "</table>";
		
		$tpl->title = $this->title;
		$tpl->content = $this->content;
		$tpl->Build("view/modules");
	}

}


?>